import { request } from '@/utils'

export default {
  // 获取用户信息
  getUser: () => request.get('/user/detail'),
  // 登出
  logout: () => request.post('/auth/logout', {}, { needTip: false }),
  // 切换当前角色
  switchCurrentRole: role => request.post(`/auth/current-role/switch/${role}`),
  // 获取角色权限
  getRolePermissions: () => request.get('/role/permissions/tree'),

  LyricsPush: data => request.post(`/lyrics/generate`,data),

  //toggleRole: data => request.post('/auth/role/toggle', data),
  login: data => request.post('/auth/login', data, { needToken: false }),

  register: data => request.post('/auth/register', data, { needToken: false }),

  changePassword: data => request.post(`/auth/password/${data.id}`, data),
  updateProfile: data => request.patch(`/user/profile/${data.id}`, data),
  updateAvatar:data=>request.post(`/user/avatar/${data.id}`, data),
}
